# -*- coding: utf-8 -*-
"""
Created on Thu Jun  4 22:00:20 2020

@author: Matrix
"""
from gesture_recognition import gesture_recognition, gesture_recognition2
from ffmpeg_img_extract import ffmpeg_img_extract,img_to_video
from combination import combination
from bgm import add_bgm3,video_merge2
from time import *
import sys

def main():

    #videopath = 'video/test3.mp4'
    videopath = sys.argv[1]
    videopath = 'video/'+str(videopath)
    
    outpath = sys.argv[2]
    outpath = 'video/'+str(outpath)
    #ffmpeg_img_extract(videopath)
    img_to_video(videopath)
    #输入需要读取图片目录
    filepath = 'images/ffmpeg_img/'
    
    #识别图像手势内容并标注保存
    bgm_label = gesture_recognition(filepath)
    #print(bgm_label)
    
    
    #图像编码
    combination(len(bgm_label))
    
    #添加bgm
    add_bgm3(bgm_label)   
    video_merge2(outpath)
    


main()